{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "# Example notebook\n",
    "\n",
    "This example will contain the following examples\n",
    "- Creating and saving a graph \n",
    "- Plotting the graph \n",
    "- Executing a node\n",
    "- Loading a graph from disk"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import matplotlib.pyplot as plt\n",
    "import networkx as nx\n",
    "from importlib import reload\n",
    "import os\n",
    "import autodepgraph as adg\n",
    "from autodepgraph import  AutoDepGraph_DAG"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Creatinga custom graph\n",
    "A graph can be instantiated and nodes can be added to the graph as with any `networkx` graph object. \n",
    "It is important to specify a `calibrat"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "cal_True_delayed=  'autodepgraph.node_functions.calibration_functions.test_calibration_True_delayed'\n",
    "test_graph = AutoDepGraph_DAG('test graph')\n",
    "for node in ['A', 'B', 'C', 'D', 'E']:\n",
    "    test_graph.add_node(node, \n",
    "                        calibrate_function=cal_True_delayed)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\u001b[0;31mSignature:\u001b[0m \u001b[0mtest_graph\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0madd_node\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnode_for_adding\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mattr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
       "\u001b[0;31mDocstring:\u001b[0m\n",
       "Adds a node to the graph, including starting attributes.\n",
       "\n",
       "attr:\n",
       "    name        (type)  = default_value\n",
       "\n",
       "    calibrate_function  = 'NotImplementedCalibration'\n",
       "    check_functions     = 'return_fixed_value'\n",
       "    tolerance   (float) = 0\n",
       "    timeout     (float) = np.inf\n",
       "    state       (str)   = 'unknown'\n",
       "\u001b[0;31mFile:\u001b[0m      ~/GitHubRepos/Personal/AutoDepGraph/autodepgraph/graph.py\n",
       "\u001b[0;31mType:\u001b[0m      method\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "test_graph.add_node?"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Some nodes require other nodes to be in a `good` or calibrated state. Such dependencies are defined by setting edges in the graph. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "test_graph.add_edge('C', 'A')\n",
    "test_graph.add_edge('C', 'B')\n",
    "test_graph.add_edge('B', 'A')\n",
    "test_graph.add_edge('D', 'A')\n",
    "test_graph.add_edge('E', 'D')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Visualizing the graph\n",
    "We support two ways of visualizing graphs: \n",
    "- matplotlib in the notebook \n",
    "- an svg in an html page that updates in real-time"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Realtime svg/html visualization "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'/Users/adriaanrol/GitHubRepos/Personal/AutoDepGraph/autodepgraph/svg_viewer/adg_graph.svg'"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# The default plotting mode is SVG \n",
    "test_graph.cfg_plot_mode = 'svg'\n",
    "# Updates the monitor, in this case the svg/html page\n",
    "test_graph.update_monitor()\n",
    "\n",
    "# Updating the monitor overwrites an svg file whose location is determined by the attribute:\n",
    "test_graph.cfg_svg_filename"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"162pt\" height=\"188pt\" viewBox=\"0.00 0.00 162.00 188.00\">\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 184)\">\n",
       "<title>test graph</title>\n",
       "<polygon fill=\"white\" stroke=\"transparent\" points=\"-4,4 -4,-184 158,-184 158,4 -4,4\"/>\n",
       "<!-- A -->\n",
       "<g id=\"node1\" class=\"node\">\n",
       "<title>A</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"55\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"55\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\">A</text>\n",
       "</g>\n",
       "<!-- B -->\n",
       "<g id=\"node2\" class=\"node\">\n",
       "<title>B</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"55\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"55\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\">B</text>\n",
       "</g>\n",
       "<!-- B&#45;&gt;A -->\n",
       "<g id=\"edge1\" class=\"edge\">\n",
       "<title>B-&gt;A</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M55,-71.7C55,-63.98 55,-54.71 55,-46.11\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"58.5,-46.1 55,-36.1 51.5,-46.1 58.5,-46.1\"/>\n",
       "</g>\n",
       "<!-- C -->\n",
       "<g id=\"node3\" class=\"node\">\n",
       "<title>C</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"27\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"27\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\">C</text>\n",
       "</g>\n",
       "<!-- C&#45;&gt;A -->\n",
       "<g id=\"edge2\" class=\"edge\">\n",
       "<title>C-&gt;A</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M21.75,-144.2C16.91,-126 11.52,-96.32 19,-72 22.29,-61.31 28.54,-50.85 34.93,-42.08\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"37.88,-43.98 41.25,-33.93 32.35,-39.69 37.88,-43.98\"/>\n",
       "</g>\n",
       "<!-- C&#45;&gt;B -->\n",
       "<g id=\"edge3\" class=\"edge\">\n",
       "<title>C-&gt;B</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M33.64,-144.41C36.91,-136.22 40.94,-126.14 44.62,-116.95\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"47.95,-118.05 48.41,-107.47 41.45,-115.45 47.95,-118.05\"/>\n",
       "</g>\n",
       "<!-- D -->\n",
       "<g id=\"node4\" class=\"node\">\n",
       "<title>D</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"127\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"127\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\">D</text>\n",
       "</g>\n",
       "<!-- D&#45;&gt;A -->\n",
       "<g id=\"edge4\" class=\"edge\">\n",
       "<title>D-&gt;A</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M112.43,-74.83C102.25,-64.94 88.48,-51.55 76.97,-40.36\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"79.41,-37.85 69.8,-33.38 74.53,-42.87 79.41,-37.85\"/>\n",
       "</g>\n",
       "<!-- E -->\n",
       "<g id=\"node5\" class=\"node\">\n",
       "<title>E</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"127\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"127\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\">E</text>\n",
       "</g>\n",
       "<!-- E&#45;&gt;D -->\n",
       "<g id=\"edge5\" class=\"edge\">\n",
       "<title>E-&gt;D</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M127,-143.7C127,-135.98 127,-126.71 127,-118.11\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"130.5,-118.1 127,-108.1 123.5,-118.1 130.5,-118.1\"/>\n",
       "</g>\n",
       "</g>\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.SVG object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from IPython.display import display, SVG\n",
    "display(SVG(test_graph.cfg_svg_filename))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/Users/adriaanrol/GitHubRepos/Personal/AutoDepGraph/autodepgraph/svg_viewer/svgviewer-etruszyd.html\n"
     ]
    }
   ],
   "source": [
    "# The html page is located at the location specified by the url. \n",
    "# The page generated based on a template when the open_html_viewer command is called. \n",
    "url = test_graph.open_html_viewer()\n",
    "print(url)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Matplotlib drawing of the graph\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAV0AAAD3CAYAAAC+eIeLAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy86wFpkAAAACXBIWXMAAAsTAAALEwEAmpwYAAAh3klEQVR4nO3debxVdb3/8dfnHAYBkUFyyhENTNcx1LTAVLxCpCLYFafSlDRKcSa1mzl2tcEyAXEsUjFzSNKDWPxMuKhhalHKsuya4pDXEUVBZvj8/viuI4ftPpx9ztl7rT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uuy0PPvhgS+fpVbIKRaRgCt3yl3eBA0BjYyODBw+mT58+ABx66KE0Nja2dLjGkUTKgHYZK3/vEKZ3bWDFihXMmjWLtWvXMnToUABWrVrFkiVL+Oc//8nAgQNzP6JOuyJlQKFb/h4GOue+OHv2bOrq6pg+fTqdO69/e8KECTQ2NnLeeec1P3wZMK3klYpIqzS8UOaiKHofuJucu93GxkaOOOIItt56a/r16/fRr+OOO46ZM2eyZs0Gh9cBv0ixbBFpgaaMVYA4jvcA/kTbV6NBGBP+bRRFRxW3KhFpD93pVoAoip4hLGZY1saPOrCY0DBSRMqAQrdynE3Yf+HDAo9fSwjcg6IoUvtzkTKh0K0QURStA75KWMK7jLCRTT5rgOXAfGCvKIoWpFOhiBRCY7oVKI7jHsCxwAWE7RlXERZQrCa0Yr8miqK/Z1ehiLREoVvh4jjuRFhtthxYHkWR/oeKlDGFrohIijSmKyKSIoWuiEiKFLoiIilS6IqIpEihKyKSIoWuiEiKFLoiIilS6IqIpEihKyKSIoWuiEiKFLoiIilS6IqIpEihKyKSIoWuiEiKFLoiIin6/9oT0afz+c0xAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "\n",
    "\n",
    "# Alternatively a render in matplotlib can be drawn \n",
    "test_graph.draw_mpl()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Maintaining the graph "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "test_graph.set_all_node_states('needs calibration')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Maintaining node \"B\".\n",
      "Maintaining node \"A\".\n",
      "\tCalibrating node A.\n",
      "\tCalibration of node A successful.\n",
      "\tCalibrating node B.\n",
      "\tCalibration of node B successful.\n"
     ]
    }
   ],
   "source": [
    "test_graph.maintain_B()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"162pt\" height=\"188pt\" viewBox=\"0.00 0.00 162.00 188.00\">\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 184)\">\n",
       "<title>test graph</title>\n",
       "<polygon fill=\"white\" stroke=\"transparent\" points=\"-4,4 -4,-184 158,-184 158,4 -4,4\"/>\n",
       "<!-- A -->\n",
       "<g id=\"node1\" class=\"node\">\n",
       "<title>A</title>\n",
       "<ellipse fill=\"#2ca02c\" stroke=\"#2ca02c\" cx=\"55\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"55\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\">A</text>\n",
       "</g>\n",
       "<!-- B -->\n",
       "<g id=\"node2\" class=\"node\">\n",
       "<title>B</title>\n",
       "<ellipse fill=\"#2ca02c\" stroke=\"#2ca02c\" cx=\"55\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"55\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\">B</text>\n",
       "</g>\n",
       "<!-- B&#45;&gt;A -->\n",
       "<g id=\"edge1\" class=\"edge\">\n",
       "<title>B-&gt;A</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M55,-71.7C55,-63.98 55,-54.71 55,-46.11\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"58.5,-46.1 55,-36.1 51.5,-46.1 58.5,-46.1\"/>\n",
       "</g>\n",
       "<!-- C -->\n",
       "<g id=\"node3\" class=\"node\">\n",
       "<title>C</title>\n",
       "<ellipse fill=\"#ff7f0e\" stroke=\"#ff7f0e\" cx=\"27\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"27\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\">C</text>\n",
       "</g>\n",
       "<!-- C&#45;&gt;A -->\n",
       "<g id=\"edge2\" class=\"edge\">\n",
       "<title>C-&gt;A</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M21.75,-144.2C16.91,-126 11.52,-96.32 19,-72 22.29,-61.31 28.54,-50.85 34.93,-42.08\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"37.88,-43.98 41.25,-33.93 32.35,-39.69 37.88,-43.98\"/>\n",
       "</g>\n",
       "<!-- C&#45;&gt;B -->\n",
       "<g id=\"edge3\" class=\"edge\">\n",
       "<title>C-&gt;B</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M33.64,-144.41C36.91,-136.22 40.94,-126.14 44.62,-116.95\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"47.95,-118.05 48.41,-107.47 41.45,-115.45 47.95,-118.05\"/>\n",
       "</g>\n",
       "<!-- D -->\n",
       "<g id=\"node4\" class=\"node\">\n",
       "<title>D</title>\n",
       "<ellipse fill=\"#ff7f0e\" stroke=\"#ff7f0e\" cx=\"127\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"127\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\">D</text>\n",
       "</g>\n",
       "<!-- D&#45;&gt;A -->\n",
       "<g id=\"edge4\" class=\"edge\">\n",
       "<title>D-&gt;A</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M112.43,-74.83C102.25,-64.94 88.48,-51.55 76.97,-40.36\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"79.41,-37.85 69.8,-33.38 74.53,-42.87 79.41,-37.85\"/>\n",
       "</g>\n",
       "<!-- E -->\n",
       "<g id=\"node5\" class=\"node\">\n",
       "<title>E</title>\n",
       "<ellipse fill=\"#ff7f0e\" stroke=\"#ff7f0e\" cx=\"127\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"127\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\">E</text>\n",
       "</g>\n",
       "<!-- E&#45;&gt;D -->\n",
       "<g id=\"edge5\" class=\"edge\">\n",
       "<title>E-&gt;D</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M127,-143.7C127,-135.98 127,-126.71 127,-118.11\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"130.5,-118.1 127,-108.1 123.5,-118.1 130.5,-118.1\"/>\n",
       "</g>\n",
       "</g>\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.SVG object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "display(SVG(test_graph.cfg_svg_filename))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Update the plotting monitor (default matplotlib) to show your graph\n",
    "test_graph.update_monitor()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "test_graph.set_all_node_states('needs calibration')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Maintaining node \"E\".\n",
      "Maintaining node \"D\".\n",
      "Maintaining node \"A\".\n",
      "\tCalibrating node A.\n",
      "\tCalibration of node A successful.\n",
      "\tCalibrating node D.\n",
      "\tCalibration of node D successful.\n",
      "\tCalibrating node E.\n",
      "\tCalibration of node E successful.\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "'good'"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test_graph.maintain_node('E')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"162pt\" height=\"188pt\" viewBox=\"0.00 0.00 162.00 188.00\">\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 184)\">\n",
       "<title>test graph</title>\n",
       "<polygon fill=\"white\" stroke=\"transparent\" points=\"-4,4 -4,-184 158,-184 158,4 -4,4\"/>\n",
       "<!-- A -->\n",
       "<g id=\"node1\" class=\"node\">\n",
       "<title>A</title>\n",
       "<ellipse fill=\"#2ca02c\" stroke=\"#2ca02c\" cx=\"55\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"55\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\">A</text>\n",
       "</g>\n",
       "<!-- B -->\n",
       "<g id=\"node2\" class=\"node\">\n",
       "<title>B</title>\n",
       "<ellipse fill=\"#ff7f0e\" stroke=\"#ff7f0e\" cx=\"55\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"55\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\">B</text>\n",
       "</g>\n",
       "<!-- B&#45;&gt;A -->\n",
       "<g id=\"edge1\" class=\"edge\">\n",
       "<title>B-&gt;A</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M55,-71.7C55,-63.98 55,-54.71 55,-46.11\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"58.5,-46.1 55,-36.1 51.5,-46.1 58.5,-46.1\"/>\n",
       "</g>\n",
       "<!-- C -->\n",
       "<g id=\"node3\" class=\"node\">\n",
       "<title>C</title>\n",
       "<ellipse fill=\"#ff7f0e\" stroke=\"#ff7f0e\" cx=\"27\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"27\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\">C</text>\n",
       "</g>\n",
       "<!-- C&#45;&gt;A -->\n",
       "<g id=\"edge2\" class=\"edge\">\n",
       "<title>C-&gt;A</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M21.75,-144.2C16.91,-126 11.52,-96.32 19,-72 22.29,-61.31 28.54,-50.85 34.93,-42.08\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"37.88,-43.98 41.25,-33.93 32.35,-39.69 37.88,-43.98\"/>\n",
       "</g>\n",
       "<!-- C&#45;&gt;B -->\n",
       "<g id=\"edge3\" class=\"edge\">\n",
       "<title>C-&gt;B</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M33.64,-144.41C36.91,-136.22 40.94,-126.14 44.62,-116.95\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"47.95,-118.05 48.41,-107.47 41.45,-115.45 47.95,-118.05\"/>\n",
       "</g>\n",
       "<!-- D -->\n",
       "<g id=\"node4\" class=\"node\">\n",
       "<title>D</title>\n",
       "<ellipse fill=\"#2ca02c\" stroke=\"#2ca02c\" cx=\"127\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"127\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\">D</text>\n",
       "</g>\n",
       "<!-- D&#45;&gt;A -->\n",
       "<g id=\"edge4\" class=\"edge\">\n",
       "<title>D-&gt;A</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M112.43,-74.83C102.25,-64.94 88.48,-51.55 76.97,-40.36\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"79.41,-37.85 69.8,-33.38 74.53,-42.87 79.41,-37.85\"/>\n",
       "</g>\n",
       "<!-- E -->\n",
       "<g id=\"node5\" class=\"node\">\n",
       "<title>E</title>\n",
       "<ellipse fill=\"#2ca02c\" stroke=\"#2ca02c\" cx=\"127\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"127\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\">E</text>\n",
       "</g>\n",
       "<!-- E&#45;&gt;D -->\n",
       "<g id=\"edge5\" class=\"edge\">\n",
       "<title>E-&gt;D</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M127,-143.7C127,-135.98 127,-126.71 127,-118.11\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"130.5,-118.1 127,-108.1 123.5,-118.1 130.5,-118.1\"/>\n",
       "</g>\n",
       "</g>\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.SVG object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "display(SVG(test_graph.cfg_svg_filename))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Three qubit example\n",
    "\n",
    "This example shows a more realistic graph. \n",
    "The examples below show ways of exploring the graph"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "test_dir = os.path.join(adg.__path__[0], 'tests', 'test_data')\n",
    "fn = os.path.join(test_dir, 'three_qubit_graph.yaml')\n",
    "DAG = nx.readwrite.read_yaml(fn)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"2606pt\" height=\"692pt\" viewBox=\"0.00 0.00 2606.28 692.00\">\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 688)\">\n",
       "<title>q2 DAG</title>\n",
       "<polygon fill=\"white\" stroke=\"transparent\" points=\"-4,4 -4,-688 2602.28,-688 2602.28,4 -4,4\"/>\n",
       "<!-- 3 qubit device multiplexed readout -->\n",
       "<g id=\"node1\" class=\"node\">\n",
       "<title>3 qubit device multiplexed readout</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"1362.79\" cy=\"-522\" rx=\"134.58\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"1362.79\" y=\"-518.3\" font-family=\"Times,serif\" font-size=\"14.00\">3 qubit device multiplexed readout</text>\n",
       "</g>\n",
       "<!-- q0 optimal weights -->\n",
       "<g id=\"node2\" class=\"node\">\n",
       "<title>q0 optimal weights</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"1103.79\" cy=\"-450\" rx=\"79.09\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"1103.79\" y=\"-446.3\" font-family=\"Times,serif\" font-size=\"14.00\">q0 optimal weights</text>\n",
       "</g>\n",
       "<!-- 3 qubit device multiplexed readout&#45;&gt;q0 optimal weights -->\n",
       "<g id=\"edge1\" class=\"edge\">\n",
       "<title>3 qubit device multiplexed readout-&gt;q0 optimal weights</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1305.95,-505.64C1263.4,-494.14 1205.38,-478.46 1162.41,-466.84\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1163.22,-463.44 1152.65,-464.21 1161.39,-470.19 1163.22,-463.44\"/>\n",
       "</g>\n",
       "<!-- q1 optimal weights -->\n",
       "<g id=\"node3\" class=\"node\">\n",
       "<title>q1 optimal weights</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"1456.79\" cy=\"-450\" rx=\"79.09\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"1456.79\" y=\"-446.3\" font-family=\"Times,serif\" font-size=\"14.00\">q1 optimal weights</text>\n",
       "</g>\n",
       "<!-- 3 qubit device multiplexed readout&#45;&gt;q1 optimal weights -->\n",
       "<g id=\"edge2\" class=\"edge\">\n",
       "<title>3 qubit device multiplexed readout-&gt;q1 optimal weights</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1385.55,-504.05C1397.85,-494.89 1413.2,-483.46 1426.5,-473.56\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1428.96,-476.09 1434.89,-467.31 1424.78,-470.47 1428.96,-476.09\"/>\n",
       "</g>\n",
       "<!-- q2 optimal weights -->\n",
       "<g id=\"node4\" class=\"node\">\n",
       "<title>q2 optimal weights</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"2211.79\" cy=\"-450\" rx=\"79.09\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"2211.79\" y=\"-446.3\" font-family=\"Times,serif\" font-size=\"14.00\">q2 optimal weights</text>\n",
       "</g>\n",
       "<!-- 3 qubit device multiplexed readout&#45;&gt;q2 optimal weights -->\n",
       "<g id=\"edge3\" class=\"edge\">\n",
       "<title>3 qubit device multiplexed readout-&gt;q2 optimal weights</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1457.62,-509.23C1474,-507.36 1490.88,-505.54 1506.79,-504 1729.9,-482.45 1993.45,-464.68 2126.21,-456.26\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"2126.56,-459.74 2136.32,-455.62 2126.12,-452.76 2126.56,-459.74\"/>\n",
       "</g>\n",
       "<!-- q0 pulse amplitude med -->\n",
       "<g id=\"node28\" class=\"node\">\n",
       "<title>q0 pulse amplitude med</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"989.79\" cy=\"-378\" rx=\"96.68\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"989.79\" y=\"-374.3\" font-family=\"Times,serif\" font-size=\"14.00\">q0 pulse amplitude med</text>\n",
       "</g>\n",
       "<!-- q0 optimal weights&#45;&gt;q0 pulse amplitude med -->\n",
       "<g id=\"edge26\" class=\"edge\">\n",
       "<title>q0 optimal weights-&gt;q0 pulse amplitude med</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1077.64,-432.94C1062.08,-423.39 1042.12,-411.13 1025.17,-400.72\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1026.97,-397.72 1016.61,-395.47 1023.31,-403.69 1026.97,-397.72\"/>\n",
       "</g>\n",
       "<!-- q1 pulse amplitude med -->\n",
       "<g id=\"node40\" class=\"node\">\n",
       "<title>q1 pulse amplitude med</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"1456.79\" cy=\"-378\" rx=\"96.68\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"1456.79\" y=\"-374.3\" font-family=\"Times,serif\" font-size=\"14.00\">q1 pulse amplitude med</text>\n",
       "</g>\n",
       "<!-- q1 optimal weights&#45;&gt;q1 pulse amplitude med -->\n",
       "<g id=\"edge43\" class=\"edge\">\n",
       "<title>q1 optimal weights-&gt;q1 pulse amplitude med</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1456.79,-431.7C1456.79,-423.98 1456.79,-414.71 1456.79,-406.11\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1460.29,-406.1 1456.79,-396.1 1453.29,-406.1 1460.29,-406.1\"/>\n",
       "</g>\n",
       "<!-- q2 pulse amplitude med -->\n",
       "<g id=\"node53\" class=\"node\">\n",
       "<title>q2 pulse amplitude med</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"2220.79\" cy=\"-378\" rx=\"96.68\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"2220.79\" y=\"-374.3\" font-family=\"Times,serif\" font-size=\"14.00\">q2 pulse amplitude med</text>\n",
       "</g>\n",
       "<!-- q2 optimal weights&#45;&gt;q2 pulse amplitude med -->\n",
       "<g id=\"edge60\" class=\"edge\">\n",
       "<title>q2 optimal weights-&gt;q2 pulse amplitude med</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M2214.02,-431.7C2215.01,-423.98 2216.2,-414.71 2217.31,-406.11\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"2220.79,-406.47 2218.59,-396.1 2213.85,-405.58 2220.79,-406.47\"/>\n",
       "</g>\n",
       "<!-- 3 qubit device resonator frequencies coarse -->\n",
       "<g id=\"node5\" class=\"node\">\n",
       "<title>3 qubit device resonator frequencies coarse</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"1512.79\" cy=\"-18\" rx=\"163.57\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"1512.79\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\">3 qubit device resonator frequencies coarse</text>\n",
       "</g>\n",
       "<!-- AWG8 Flux&#45;staircase -->\n",
       "<g id=\"node6\" class=\"node\">\n",
       "<title>AWG8 Flux-staircase</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"1679.79\" cy=\"-450\" rx=\"87.99\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"1679.79\" y=\"-446.3\" font-family=\"Times,serif\" font-size=\"14.00\">AWG8 Flux-staircase</text>\n",
       "</g>\n",
       "<!-- AWG8 MW&#45;staircase -->\n",
       "<g id=\"node7\" class=\"node\">\n",
       "<title>AWG8 MW-staircase</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"1108.79\" cy=\"-162\" rx=\"88.28\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"1108.79\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\">AWG8 MW-staircase</text>\n",
       "</g>\n",
       "<!-- CZ q0&#45;q1 -->\n",
       "<g id=\"node8\" class=\"node\">\n",
       "<title>CZ q0-q1</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"1316.79\" cy=\"-666\" rx=\"44.69\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"1316.79\" y=\"-662.3\" font-family=\"Times,serif\" font-size=\"14.00\">CZ q0-q1</text>\n",
       "</g>\n",
       "<!-- Chevron q0&#45;q1 -->\n",
       "<g id=\"node9\" class=\"node\">\n",
       "<title>Chevron q0-q1</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"1316.79\" cy=\"-594\" rx=\"63.89\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"1316.79\" y=\"-590.3\" font-family=\"Times,serif\" font-size=\"14.00\">Chevron q0-q1</text>\n",
       "</g>\n",
       "<!-- CZ q0&#45;q1&#45;&gt;Chevron q0&#45;q1 -->\n",
       "<g id=\"edge4\" class=\"edge\">\n",
       "<title>CZ q0-q1-&gt;Chevron q0-q1</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1316.79,-647.7C1316.79,-639.98 1316.79,-630.71 1316.79,-622.11\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1320.29,-622.1 1316.79,-612.1 1313.29,-622.1 1320.29,-622.1\"/>\n",
       "</g>\n",
       "<!-- q0 cryo dist. corr. -->\n",
       "<g id=\"node10\" class=\"node\">\n",
       "<title>q0 cryo dist. corr.</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"1103.79\" cy=\"-594\" rx=\"73.39\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"1103.79\" y=\"-590.3\" font-family=\"Times,serif\" font-size=\"14.00\">q0 cryo dist. corr.</text>\n",
       "</g>\n",
       "<!-- CZ q0&#45;q1&#45;&gt;q0 cryo dist. corr. -->\n",
       "<g id=\"edge5\" class=\"edge\">\n",
       "<title>CZ q0-q1-&gt;q0 cryo dist. corr.</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1283.04,-653.91C1248.69,-642.62 1194.99,-624.97 1155.32,-611.93\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1156.4,-608.61 1145.81,-608.81 1154.21,-615.26 1156.4,-608.61\"/>\n",
       "</g>\n",
       "<!-- q1 cryo dist. corr. -->\n",
       "<g id=\"node11\" class=\"node\">\n",
       "<title>q1 cryo dist. corr.</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"1628.79\" cy=\"-594\" rx=\"73.39\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"1628.79\" y=\"-590.3\" font-family=\"Times,serif\" font-size=\"14.00\">q1 cryo dist. corr.</text>\n",
       "</g>\n",
       "<!-- CZ q0&#45;q1&#45;&gt;q1 cryo dist. corr. -->\n",
       "<g id=\"edge6\" class=\"edge\">\n",
       "<title>CZ q0-q1-&gt;q1 cryo dist. corr.</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1355.05,-656.42C1407.8,-644.58 1503.48,-623.11 1566.59,-608.96\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1567.44,-612.35 1576.43,-606.75 1565.9,-605.52 1567.44,-612.35\"/>\n",
       "</g>\n",
       "<!-- Chevron q0&#45;q1&#45;&gt;3 qubit device multiplexed readout -->\n",
       "<g id=\"edge10\" class=\"edge\">\n",
       "<title>Chevron q0-q1-&gt;3 qubit device multiplexed readout</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1327.93,-576.05C1333.33,-567.84 1339.93,-557.79 1345.93,-548.66\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1348.87,-550.55 1351.44,-540.28 1343.02,-546.71 1348.87,-550.55\"/>\n",
       "</g>\n",
       "<!-- Chevron q0&#45;q1&#45;&gt;AWG8 Flux&#45;staircase -->\n",
       "<g id=\"edge11\" class=\"edge\">\n",
       "<title>Chevron q0-q1-&gt;AWG8 Flux-staircase</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1273.01,-580.8C1252.77,-572.72 1230.63,-559.85 1218.79,-540 1210.6,-526.26 1208.12,-515.92 1218.79,-504 1267.42,-449.71 1472.41,-476.55 1544.79,-468 1561.85,-465.98 1580.12,-463.74 1597.52,-461.56\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1598.17,-465.01 1607.65,-460.29 1597.29,-458.06 1598.17,-465.01\"/>\n",
       "</g>\n",
       "<!-- q0 gates restless -->\n",
       "<g id=\"node15\" class=\"node\">\n",
       "<title>q0 gates restless</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"1103.79\" cy=\"-522\" rx=\"68.49\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"1103.79\" y=\"-518.3\" font-family=\"Times,serif\" font-size=\"14.00\">q0 gates restless</text>\n",
       "</g>\n",
       "<!-- Chevron q0&#45;q1&#45;&gt;q0 gates restless -->\n",
       "<g id=\"edge12\" class=\"edge\">\n",
       "<title>Chevron q0-q1-&gt;q0 gates restless</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1276.73,-579.83C1242.1,-568.45 1191.88,-551.95 1154.47,-539.65\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1155.36,-536.26 1144.76,-536.46 1153.17,-542.91 1155.36,-536.26\"/>\n",
       "</g>\n",
       "<!-- q1 gates restless -->\n",
       "<g id=\"node16\" class=\"node\">\n",
       "<title>q1 gates restless</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"1583.79\" cy=\"-522\" rx=\"68.49\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"1583.79\" y=\"-518.3\" font-family=\"Times,serif\" font-size=\"14.00\">q1 gates restless</text>\n",
       "</g>\n",
       "<!-- Chevron q0&#45;q1&#45;&gt;q1 gates restless -->\n",
       "<g id=\"edge13\" class=\"edge\">\n",
       "<title>Chevron q0-q1-&gt;q1 gates restless</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1361.78,-581.2C1407.39,-569.25 1478.07,-550.72 1527.39,-537.79\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1528.48,-541.12 1537.27,-535.2 1526.71,-534.35 1528.48,-541.12\"/>\n",
       "</g>\n",
       "<!-- q0 cryo dist. corr.&#45;&gt;q0 gates restless -->\n",
       "<g id=\"edge21\" class=\"edge\">\n",
       "<title>q0 cryo dist. corr.-&gt;q0 gates restless</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1103.79,-575.7C1103.79,-567.98 1103.79,-558.71 1103.79,-550.11\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1107.29,-550.1 1103.79,-540.1 1100.29,-550.1 1107.29,-550.1\"/>\n",
       "</g>\n",
       "<!-- q0 room temp. dist. corr. -->\n",
       "<g id=\"node21\" class=\"node\">\n",
       "<title>q0 room temp. dist. corr.</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"917.79\" cy=\"-522\" rx=\"100.18\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"917.79\" y=\"-518.3\" font-family=\"Times,serif\" font-size=\"14.00\">q0 room temp. dist. corr.</text>\n",
       "</g>\n",
       "<!-- q0 cryo dist. corr.&#45;&gt;q0 room temp. dist. corr. -->\n",
       "<g id=\"edge22\" class=\"edge\">\n",
       "<title>q0 cryo dist. corr.-&gt;q0 room temp. dist. corr.</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1065.25,-578.5C1037.22,-567.94 998.98,-553.56 968.47,-542.07\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"969.45,-538.7 958.86,-538.46 966.99,-545.25 969.45,-538.7\"/>\n",
       "</g>\n",
       "<!-- q1 cryo dist. corr.&#45;&gt;q1 gates restless -->\n",
       "<g id=\"edge38\" class=\"edge\">\n",
       "<title>q1 cryo dist. corr.-&gt;q1 gates restless</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1617.9,-576.05C1612.54,-567.71 1605.96,-557.49 1600.02,-548.25\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1602.94,-546.31 1594.58,-539.79 1597.05,-550.09 1602.94,-546.31\"/>\n",
       "</g>\n",
       "<!-- q1 room temp. dist. corr. -->\n",
       "<g id=\"node33\" class=\"node\">\n",
       "<title>q1 room temp. dist. corr.</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"1807.79\" cy=\"-522\" rx=\"100.18\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"1807.79\" y=\"-518.3\" font-family=\"Times,serif\" font-size=\"14.00\">q1 room temp. dist. corr.</text>\n",
       "</g>\n",
       "<!-- q1 cryo dist. corr.&#45;&gt;q1 room temp. dist. corr. -->\n",
       "<g id=\"edge39\" class=\"edge\">\n",
       "<title>q1 cryo dist. corr.-&gt;q1 room temp. dist. corr.</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1666.32,-578.33C1693.03,-567.88 1729.19,-553.74 1758.27,-542.37\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1759.79,-545.53 1767.83,-538.63 1757.24,-539.01 1759.79,-545.53\"/>\n",
       "</g>\n",
       "<!-- CZ q1&#45;q2 -->\n",
       "<g id=\"node12\" class=\"node\">\n",
       "<title>CZ q1-q2</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"1628.79\" cy=\"-666\" rx=\"44.69\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"1628.79\" y=\"-662.3\" font-family=\"Times,serif\" font-size=\"14.00\">CZ q1-q2</text>\n",
       "</g>\n",
       "<!-- CZ q1&#45;q2&#45;&gt;q1 cryo dist. corr. -->\n",
       "<g id=\"edge8\" class=\"edge\">\n",
       "<title>CZ q1-q2-&gt;q1 cryo dist. corr.</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1628.79,-647.7C1628.79,-639.98 1628.79,-630.71 1628.79,-622.11\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1632.29,-622.1 1628.79,-612.1 1625.29,-622.1 1632.29,-622.1\"/>\n",
       "</g>\n",
       "<!-- Chevron q1&#45;q2 -->\n",
       "<g id=\"node13\" class=\"node\">\n",
       "<title>Chevron q1-q2</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"1473.79\" cy=\"-594\" rx=\"63.89\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"1473.79\" y=\"-590.3\" font-family=\"Times,serif\" font-size=\"14.00\">Chevron q1-q2</text>\n",
       "</g>\n",
       "<!-- CZ q1&#45;q2&#45;&gt;Chevron q1&#45;q2 -->\n",
       "<g id=\"edge7\" class=\"edge\">\n",
       "<title>CZ q1-q2-&gt;Chevron q1-q2</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1600,-652C1576.19,-641.25 1542.07,-625.84 1515.31,-613.75\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1516.73,-610.55 1506.18,-609.63 1513.85,-616.93 1516.73,-610.55\"/>\n",
       "</g>\n",
       "<!-- q2 cryo dist. corr. -->\n",
       "<g id=\"node14\" class=\"node\">\n",
       "<title>q2 cryo dist. corr.</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"2025.79\" cy=\"-594\" rx=\"73.39\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"2025.79\" y=\"-590.3\" font-family=\"Times,serif\" font-size=\"14.00\">q2 cryo dist. corr.</text>\n",
       "</g>\n",
       "<!-- CZ q1&#45;q2&#45;&gt;q2 cryo dist. corr. -->\n",
       "<g id=\"edge9\" class=\"edge\">\n",
       "<title>CZ q1-q2-&gt;q2 cryo dist. corr.</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1669.04,-657.9C1736.88,-645.94 1874.7,-621.64 1957.78,-606.99\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1958.64,-610.39 1967.88,-605.21 1957.42,-603.5 1958.64,-610.39\"/>\n",
       "</g>\n",
       "<!-- Chevron q1&#45;q2&#45;&gt;3 qubit device multiplexed readout -->\n",
       "<g id=\"edge14\" class=\"edge\">\n",
       "<title>Chevron q1-q2-&gt;3 qubit device multiplexed readout</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1448.88,-577.29C1434,-567.9 1414.84,-555.82 1398.38,-545.44\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1399.88,-542.25 1389.56,-539.88 1396.15,-548.17 1399.88,-542.25\"/>\n",
       "</g>\n",
       "<!-- Chevron q1&#45;q2&#45;&gt;AWG8 Flux&#45;staircase -->\n",
       "<g id=\"edge15\" class=\"edge\">\n",
       "<title>Chevron q1-q2-&gt;AWG8 Flux-staircase</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1519.38,-581.34C1573.12,-567.4 1655.83,-545.3 1660.79,-540 1676.19,-523.55 1680.33,-497.82 1680.97,-478.24\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1684.47,-478.11 1681.02,-468.1 1677.47,-478.08 1684.47,-478.11\"/>\n",
       "</g>\n",
       "<!-- Chevron q1&#45;q2&#45;&gt;q0 gates restless -->\n",
       "<g id=\"edge16\" class=\"edge\">\n",
       "<title>Chevron q1-q2-&gt;q0 gates restless</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1423.63,-582.71C1412.49,-580.46 1400.75,-578.12 1389.79,-576 1313.91,-561.29 1226.53,-545.23 1168.53,-534.68\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1168.87,-531.19 1158.4,-532.84 1167.62,-538.08 1168.87,-531.19\"/>\n",
       "</g>\n",
       "<!-- Chevron q1&#45;q2&#45;&gt;q1 gates restless -->\n",
       "<g id=\"edge17\" class=\"edge\">\n",
       "<title>Chevron q1-q2-&gt;q1 gates restless</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1498.48,-577.29C1513.66,-567.63 1533.31,-555.12 1549.93,-544.55\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1552.25,-547.22 1558.81,-538.9 1548.49,-541.32 1552.25,-547.22\"/>\n",
       "</g>\n",
       "<!-- q2 gates restless -->\n",
       "<g id=\"node45\" class=\"node\">\n",
       "<title>q2 gates restless</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"2211.79\" cy=\"-522\" rx=\"68.49\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"2211.79\" y=\"-518.3\" font-family=\"Times,serif\" font-size=\"14.00\">q2 gates restless</text>\n",
       "</g>\n",
       "<!-- q2 cryo dist. corr.&#45;&gt;q2 gates restless -->\n",
       "<g id=\"edge55\" class=\"edge\">\n",
       "<title>q2 cryo dist. corr.-&gt;q2 gates restless</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M2064.33,-578.5C2093.42,-567.55 2133.49,-552.47 2164.52,-540.79\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"2166.13,-543.92 2174.25,-537.13 2163.66,-537.37 2166.13,-543.92\"/>\n",
       "</g>\n",
       "<!-- q2 room temp. dist. corr. -->\n",
       "<g id=\"node46\" class=\"node\">\n",
       "<title>q2 room temp. dist. corr.</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"2025.79\" cy=\"-522\" rx=\"100.18\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"2025.79\" y=\"-518.3\" font-family=\"Times,serif\" font-size=\"14.00\">q2 room temp. dist. corr.</text>\n",
       "</g>\n",
       "<!-- q2 cryo dist. corr.&#45;&gt;q2 room temp. dist. corr. -->\n",
       "<g id=\"edge56\" class=\"edge\">\n",
       "<title>q2 cryo dist. corr.-&gt;q2 room temp. dist. corr.</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M2025.79,-575.7C2025.79,-567.98 2025.79,-558.71 2025.79,-550.11\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"2029.29,-550.1 2025.79,-540.1 2022.29,-550.1 2029.29,-550.1\"/>\n",
       "</g>\n",
       "<!-- q0 gates restless&#45;&gt;q0 optimal weights -->\n",
       "<g id=\"edge25\" class=\"edge\">\n",
       "<title>q0 gates restless-&gt;q0 optimal weights</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1103.79,-503.7C1103.79,-495.98 1103.79,-486.71 1103.79,-478.11\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1107.29,-478.1 1103.79,-468.1 1100.29,-478.1 1107.29,-478.1\"/>\n",
       "</g>\n",
       "<!-- q1 gates restless&#45;&gt;q1 optimal weights -->\n",
       "<g id=\"edge42\" class=\"edge\">\n",
       "<title>q1 gates restless-&gt;q1 optimal weights</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1555.61,-505.46C1537.69,-495.59 1514.27,-482.68 1494.73,-471.91\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1496.23,-468.74 1485.78,-466.98 1492.85,-474.87 1496.23,-468.74\"/>\n",
       "</g>\n",
       "<!-- q0 T1 -->\n",
       "<g id=\"node17\" class=\"node\">\n",
       "<title>q0 T1</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"488.79\" cy=\"-306\" rx=\"31.7\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"488.79\" y=\"-302.3\" font-family=\"Times,serif\" font-size=\"14.00\">q0 T1</text>\n",
       "</g>\n",
       "<!-- q0 pulse amplitude coarse -->\n",
       "<g id=\"node18\" class=\"node\">\n",
       "<title>q0 pulse amplitude coarse</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"589.79\" cy=\"-234\" rx=\"103.18\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"589.79\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\">q0 pulse amplitude coarse</text>\n",
       "</g>\n",
       "<!-- q0 T1&#45;&gt;q0 pulse amplitude coarse -->\n",
       "<g id=\"edge18\" class=\"edge\">\n",
       "<title>q0 T1-&gt;q0 pulse amplitude coarse</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M508.27,-291.5C522.1,-281.92 541,-268.81 557.12,-257.64\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"559.52,-260.24 565.74,-251.67 555.53,-254.49 559.52,-260.24\"/>\n",
       "</g>\n",
       "<!-- q0 pulse amplitude coarse&#45;&gt;AWG8 MW&#45;staircase -->\n",
       "<g id=\"edge27\" class=\"edge\">\n",
       "<title>q0 pulse amplitude coarse-&gt;AWG8 MW-staircase</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M674.22,-223.54C759.33,-213.73 894.4,-197.41 1010.79,-180 1018.68,-178.82 1026.92,-177.51 1035.12,-176.16\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1035.79,-179.6 1045.07,-174.5 1034.63,-172.69 1035.79,-179.6\"/>\n",
       "</g>\n",
       "<!-- q0 frequency coarse -->\n",
       "<g id=\"node22\" class=\"node\">\n",
       "<title>q0 frequency coarse</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"297.79\" cy=\"-162\" rx=\"81.79\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"297.79\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\">q0 frequency coarse</text>\n",
       "</g>\n",
       "<!-- q0 pulse amplitude coarse&#45;&gt;q0 frequency coarse -->\n",
       "<g id=\"edge28\" class=\"edge\">\n",
       "<title>q0 pulse amplitude coarse-&gt;q0 frequency coarse</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M531.75,-219.09C482.48,-207.27 411.9,-190.35 361.16,-178.19\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"361.83,-174.75 351.29,-175.83 360.2,-181.56 361.83,-174.75\"/>\n",
       "</g>\n",
       "<!-- q0 mixer offsets drive -->\n",
       "<g id=\"node25\" class=\"node\">\n",
       "<title>q0 mixer offsets drive</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"486.79\" cy=\"-162\" rx=\"89.08\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"486.79\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\">q0 mixer offsets drive</text>\n",
       "</g>\n",
       "<!-- q0 pulse amplitude coarse&#45;&gt;q0 mixer offsets drive -->\n",
       "<g id=\"edge29\" class=\"edge\">\n",
       "<title>q0 pulse amplitude coarse-&gt;q0 mixer offsets drive</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M565.38,-216.41C551.66,-207.08 534.34,-195.32 519.46,-185.2\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"521.26,-182.2 511.03,-179.47 517.33,-187.99 521.26,-182.2\"/>\n",
       "</g>\n",
       "<!-- q0 mixer offsets readout -->\n",
       "<g id=\"node26\" class=\"node\">\n",
       "<title>q0 mixer offsets readout</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"691.79\" cy=\"-162\" rx=\"97.48\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"691.79\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\">q0 mixer offsets readout</text>\n",
       "</g>\n",
       "<!-- q0 pulse amplitude coarse&#45;&gt;q0 mixer offsets readout -->\n",
       "<g id=\"edge30\" class=\"edge\">\n",
       "<title>q0 pulse amplitude coarse-&gt;q0 mixer offsets readout</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M613.96,-216.41C627.56,-207.08 644.7,-195.32 659.44,-185.2\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"661.53,-188.01 667.79,-179.47 657.57,-182.24 661.53,-188.01\"/>\n",
       "</g>\n",
       "<!-- q0 mixer skewness drive -->\n",
       "<g id=\"node27\" class=\"node\">\n",
       "<title>q0 mixer skewness drive</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"98.79\" cy=\"-162\" rx=\"98.58\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"98.79\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\">q0 mixer skewness drive</text>\n",
       "</g>\n",
       "<!-- q0 pulse amplitude coarse&#45;&gt;q0 mixer skewness drive -->\n",
       "<g id=\"edge31\" class=\"edge\">\n",
       "<title>q0 pulse amplitude coarse-&gt;q0 mixer skewness drive</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M510.14,-222.42C432.63,-212.02 311.54,-195.49 206.79,-180 198.2,-178.73 189.22,-177.37 180.28,-175.99\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"180.64,-172.51 170.22,-174.44 179.56,-179.42 180.64,-172.51\"/>\n",
       "</g>\n",
       "<!-- q0 T2&#45;echo -->\n",
       "<g id=\"node19\" class=\"node\">\n",
       "<title>q0 T2-echo</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"589.79\" cy=\"-306\" rx=\"51.19\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"589.79\" y=\"-302.3\" font-family=\"Times,serif\" font-size=\"14.00\">q0 T2-echo</text>\n",
       "</g>\n",
       "<!-- q0 T2&#45;echo&#45;&gt;q0 pulse amplitude coarse -->\n",
       "<g id=\"edge19\" class=\"edge\">\n",
       "<title>q0 T2-echo-&gt;q0 pulse amplitude coarse</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M589.79,-287.7C589.79,-279.98 589.79,-270.71 589.79,-262.11\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"593.29,-262.1 589.79,-252.1 586.29,-262.1 593.29,-262.1\"/>\n",
       "</g>\n",
       "<!-- q0 T2&#45;star -->\n",
       "<g id=\"node20\" class=\"node\">\n",
       "<title>q0 T2-star</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"706.79\" cy=\"-306\" rx=\"47.39\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"706.79\" y=\"-302.3\" font-family=\"Times,serif\" font-size=\"14.00\">q0 T2-star</text>\n",
       "</g>\n",
       "<!-- q0 T2&#45;star&#45;&gt;q0 pulse amplitude coarse -->\n",
       "<g id=\"edge20\" class=\"edge\">\n",
       "<title>q0 T2-star-&gt;q0 pulse amplitude coarse</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M682.55,-290.5C666.21,-280.72 644.37,-267.66 625.99,-256.66\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"627.66,-253.58 617.28,-251.45 624.07,-259.59 627.66,-253.58\"/>\n",
       "</g>\n",
       "<!-- q0 room temp. dist. corr.&#45;&gt;AWG8 Flux&#45;staircase -->\n",
       "<g id=\"edge34\" class=\"edge\">\n",
       "<title>q0 room temp. dist. corr.-&gt;AWG8 Flux-staircase</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M988.03,-509.14C1000.9,-507.23 1014.23,-505.41 1026.79,-504 1256.12,-478.2 1315.11,-490.43 1544.79,-468 1562.18,-466.3 1580.8,-464.17 1598.48,-461.99\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1599.27,-465.41 1608.76,-460.7 1598.4,-458.47 1599.27,-465.41\"/>\n",
       "</g>\n",
       "<!-- q0 resonator frequency -->\n",
       "<g id=\"node23\" class=\"node\">\n",
       "<title>q0 resonator frequency</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"803.79\" cy=\"-90\" rx=\"92.08\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"803.79\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\">q0 resonator frequency</text>\n",
       "</g>\n",
       "<!-- q0 frequency coarse&#45;&gt;q0 resonator frequency -->\n",
       "<g id=\"edge23\" class=\"edge\">\n",
       "<title>q0 frequency coarse-&gt;q0 resonator frequency</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M356.94,-149.44C367.53,-147.52 378.47,-145.62 388.79,-144 501.18,-126.34 631.4,-110.45 715.55,-100.77\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"716.05,-104.24 725.58,-99.63 715.25,-97.29 716.05,-104.24\"/>\n",
       "</g>\n",
       "<!-- q0 resonator frequency&#45;&gt;3 qubit device resonator frequencies coarse -->\n",
       "<g id=\"edge33\" class=\"edge\">\n",
       "<title>q0 resonator frequency-&gt;3 qubit device resonator frequencies coarse</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M884.09,-81.07C1006.15,-69.02 1239.53,-45.98 1385.05,-31.61\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1385.76,-35.06 1395.37,-30.59 1385.08,-28.09 1385.76,-35.06\"/>\n",
       "</g>\n",
       "<!-- q0 frequency fine -->\n",
       "<g id=\"node24\" class=\"node\">\n",
       "<title>q0 frequency fine</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"913.79\" cy=\"-306\" rx=\"72.59\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"913.79\" y=\"-302.3\" font-family=\"Times,serif\" font-size=\"14.00\">q0 frequency fine</text>\n",
       "</g>\n",
       "<!-- q0 frequency fine&#45;&gt;q0 pulse amplitude coarse -->\n",
       "<g id=\"edge24\" class=\"edge\">\n",
       "<title>q0 frequency fine-&gt;q0 pulse amplitude coarse</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M861.01,-293.6C806.83,-281.89 722.13,-263.59 661.81,-250.56\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"662.48,-247.12 651.97,-248.43 661,-253.97 662.48,-247.12\"/>\n",
       "</g>\n",
       "<!-- q0 pulse amplitude med&#45;&gt;q0 frequency fine -->\n",
       "<g id=\"edge32\" class=\"edge\">\n",
       "<title>q0 pulse amplitude med-&gt;q0 frequency fine</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M971.39,-360.05C961.71,-351.13 949.68,-340.06 939.13,-330.34\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"941.48,-327.75 931.76,-323.55 936.74,-332.9 941.48,-327.75\"/>\n",
       "</g>\n",
       "<!-- q1 T1 -->\n",
       "<g id=\"node29\" class=\"node\">\n",
       "<title>q1 T1</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"1100.79\" cy=\"-306\" rx=\"31.7\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"1100.79\" y=\"-302.3\" font-family=\"Times,serif\" font-size=\"14.00\">q1 T1</text>\n",
       "</g>\n",
       "<!-- q1 pulse amplitude coarse -->\n",
       "<g id=\"node30\" class=\"node\">\n",
       "<title>q1 pulse amplitude coarse</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"1313.79\" cy=\"-234\" rx=\"103.18\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"1313.79\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\">q1 pulse amplitude coarse</text>\n",
       "</g>\n",
       "<!-- q1 T1&#45;&gt;q1 pulse amplitude coarse -->\n",
       "<g id=\"edge35\" class=\"edge\">\n",
       "<title>q1 T1-&gt;q1 pulse amplitude coarse</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1125.36,-294.37C1130.74,-292.17 1136.43,-289.93 1141.79,-288 1177.89,-274.99 1218.93,-262.26 1251.87,-252.55\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1253.2,-255.8 1261.82,-249.63 1251.23,-249.08 1253.2,-255.8\"/>\n",
       "</g>\n",
       "<!-- q1 pulse amplitude coarse&#45;&gt;AWG8 MW&#45;staircase -->\n",
       "<g id=\"edge44\" class=\"edge\">\n",
       "<title>q1 pulse amplitude coarse-&gt;AWG8 MW-staircase</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1269.06,-217.72C1237.42,-206.92 1194.9,-192.4 1161.6,-181.03\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1162.62,-177.68 1152.03,-177.76 1160.36,-184.31 1162.62,-177.68\"/>\n",
       "</g>\n",
       "<!-- q1 frequency coarse -->\n",
       "<g id=\"node34\" class=\"node\">\n",
       "<title>q1 frequency coarse</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"1512.79\" cy=\"-162\" rx=\"81.79\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"1512.79\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\">q1 frequency coarse</text>\n",
       "</g>\n",
       "<!-- q1 pulse amplitude coarse&#45;&gt;q1 frequency coarse -->\n",
       "<g id=\"edge45\" class=\"edge\">\n",
       "<title>q1 pulse amplitude coarse-&gt;q1 frequency coarse</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1357.46,-217.64C1388.15,-206.84 1429.32,-192.36 1461.57,-181.02\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1462.99,-184.23 1471.26,-177.61 1460.67,-177.62 1462.99,-184.23\"/>\n",
       "</g>\n",
       "<!-- q1 mixer offsets drive -->\n",
       "<g id=\"node37\" class=\"node\">\n",
       "<title>q1 mixer offsets drive</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"1701.79\" cy=\"-162\" rx=\"89.08\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"1701.79\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\">q1 mixer offsets drive</text>\n",
       "</g>\n",
       "<!-- q1 pulse amplitude coarse&#45;&gt;q1 mixer offsets drive -->\n",
       "<g id=\"edge46\" class=\"edge\">\n",
       "<title>q1 pulse amplitude coarse-&gt;q1 mixer offsets drive</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1382.71,-220.57C1451.52,-208.15 1556.91,-189.14 1627.54,-176.4\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1628.48,-179.78 1637.7,-174.56 1627.24,-172.89 1628.48,-179.78\"/>\n",
       "</g>\n",
       "<!-- q1 mixer offsets readout -->\n",
       "<g id=\"node38\" class=\"node\">\n",
       "<title>q1 mixer offsets readout</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"904.79\" cy=\"-162\" rx=\"97.48\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"904.79\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\">q1 mixer offsets readout</text>\n",
       "</g>\n",
       "<!-- q1 pulse amplitude coarse&#45;&gt;q1 mixer offsets readout -->\n",
       "<g id=\"edge47\" class=\"edge\">\n",
       "<title>q1 pulse amplitude coarse-&gt;q1 mixer offsets readout</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1242.55,-220.81C1170.27,-208.44 1058.64,-189.33 983.72,-176.51\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"984.3,-173.06 973.85,-174.82 983.12,-179.96 984.3,-173.06\"/>\n",
       "</g>\n",
       "<!-- q1 mixer skewness drive -->\n",
       "<g id=\"node39\" class=\"node\">\n",
       "<title>q1 mixer skewness drive</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"1313.79\" cy=\"-162\" rx=\"98.58\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"1313.79\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\">q1 mixer skewness drive</text>\n",
       "</g>\n",
       "<!-- q1 pulse amplitude coarse&#45;&gt;q1 mixer skewness drive -->\n",
       "<g id=\"edge48\" class=\"edge\">\n",
       "<title>q1 pulse amplitude coarse-&gt;q1 mixer skewness drive</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1313.79,-215.7C1313.79,-207.98 1313.79,-198.71 1313.79,-190.11\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1317.29,-190.1 1313.79,-180.1 1310.29,-190.1 1317.29,-190.1\"/>\n",
       "</g>\n",
       "<!-- q1 T2&#45;echo -->\n",
       "<g id=\"node31\" class=\"node\">\n",
       "<title>q1 T2-echo</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"1201.79\" cy=\"-306\" rx=\"51.19\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"1201.79\" y=\"-302.3\" font-family=\"Times,serif\" font-size=\"14.00\">q1 T2-echo</text>\n",
       "</g>\n",
       "<!-- q1 T2&#45;echo&#45;&gt;q1 pulse amplitude coarse -->\n",
       "<g id=\"edge36\" class=\"edge\">\n",
       "<title>q1 T2-echo-&gt;q1 pulse amplitude coarse</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1225.82,-289.98C1241.25,-280.34 1261.56,-267.64 1278.78,-256.88\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1280.83,-259.73 1287.46,-251.46 1277.12,-253.79 1280.83,-259.73\"/>\n",
       "</g>\n",
       "<!-- q1 T2&#45;star -->\n",
       "<g id=\"node32\" class=\"node\">\n",
       "<title>q1 T2-star</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"1318.79\" cy=\"-306\" rx=\"47.39\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"1318.79\" y=\"-302.3\" font-family=\"Times,serif\" font-size=\"14.00\">q1 T2-star</text>\n",
       "</g>\n",
       "<!-- q1 T2&#45;star&#45;&gt;q1 pulse amplitude coarse -->\n",
       "<g id=\"edge37\" class=\"edge\">\n",
       "<title>q1 T2-star-&gt;q1 pulse amplitude coarse</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1317.56,-287.7C1317,-279.98 1316.34,-270.71 1315.73,-262.11\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1319.22,-261.83 1315.01,-252.1 1312.23,-262.33 1319.22,-261.83\"/>\n",
       "</g>\n",
       "<!-- q1 room temp. dist. corr.&#45;&gt;AWG8 Flux&#45;staircase -->\n",
       "<g id=\"edge51\" class=\"edge\">\n",
       "<title>q1 room temp. dist. corr.-&gt;AWG8 Flux-staircase</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1778.1,-504.76C1760.25,-495 1737.34,-482.47 1718.13,-471.97\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1719.77,-468.87 1709.32,-467.15 1716.41,-475.02 1719.77,-468.87\"/>\n",
       "</g>\n",
       "<!-- q1 resonator frequency -->\n",
       "<g id=\"node35\" class=\"node\">\n",
       "<title>q1 resonator frequency</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"1512.79\" cy=\"-90\" rx=\"92.08\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"1512.79\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\">q1 resonator frequency</text>\n",
       "</g>\n",
       "<!-- q1 frequency coarse&#45;&gt;q1 resonator frequency -->\n",
       "<g id=\"edge40\" class=\"edge\">\n",
       "<title>q1 frequency coarse-&gt;q1 resonator frequency</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1512.79,-143.7C1512.79,-135.98 1512.79,-126.71 1512.79,-118.11\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1516.29,-118.1 1512.79,-108.1 1509.29,-118.1 1516.29,-118.1\"/>\n",
       "</g>\n",
       "<!-- q1 resonator frequency&#45;&gt;3 qubit device resonator frequencies coarse -->\n",
       "<g id=\"edge50\" class=\"edge\">\n",
       "<title>q1 resonator frequency-&gt;3 qubit device resonator frequencies coarse</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1512.79,-71.7C1512.79,-63.98 1512.79,-54.71 1512.79,-46.11\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1516.29,-46.1 1512.79,-36.1 1509.29,-46.1 1516.29,-46.1\"/>\n",
       "</g>\n",
       "<!-- q1 frequency fine -->\n",
       "<g id=\"node36\" class=\"node\">\n",
       "<title>q1 frequency fine</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"1456.79\" cy=\"-306\" rx=\"72.59\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"1456.79\" y=\"-302.3\" font-family=\"Times,serif\" font-size=\"14.00\">q1 frequency fine</text>\n",
       "</g>\n",
       "<!-- q1 frequency fine&#45;&gt;q1 pulse amplitude coarse -->\n",
       "<g id=\"edge41\" class=\"edge\">\n",
       "<title>q1 frequency fine-&gt;q1 pulse amplitude coarse</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1425.41,-289.64C1405.05,-279.67 1378.28,-266.57 1356.05,-255.69\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1357.36,-252.43 1346.84,-251.18 1354.28,-258.72 1357.36,-252.43\"/>\n",
       "</g>\n",
       "<!-- q1 pulse amplitude med&#45;&gt;q1 frequency fine -->\n",
       "<g id=\"edge49\" class=\"edge\">\n",
       "<title>q1 pulse amplitude med-&gt;q1 frequency fine</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1456.79,-359.7C1456.79,-351.98 1456.79,-342.71 1456.79,-334.11\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1460.29,-334.1 1456.79,-324.1 1453.29,-334.1 1460.29,-334.1\"/>\n",
       "</g>\n",
       "<!-- q2 T1 -->\n",
       "<g id=\"node41\" class=\"node\">\n",
       "<title>q2 T1</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"1883.79\" cy=\"-306\" rx=\"31.7\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"1883.79\" y=\"-302.3\" font-family=\"Times,serif\" font-size=\"14.00\">q2 T1</text>\n",
       "</g>\n",
       "<!-- q2 pulse amplitude coarse -->\n",
       "<g id=\"node42\" class=\"node\">\n",
       "<title>q2 pulse amplitude coarse</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"2101.79\" cy=\"-234\" rx=\"103.18\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"2101.79\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\">q2 pulse amplitude coarse</text>\n",
       "</g>\n",
       "<!-- q2 T1&#45;&gt;q2 pulse amplitude coarse -->\n",
       "<g id=\"edge52\" class=\"edge\">\n",
       "<title>q2 T1-&gt;q2 pulse amplitude coarse</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1908.35,-294.34C1913.73,-292.14 1919.42,-289.91 1924.79,-288 1962.06,-274.73 2004.5,-261.95 2038.48,-252.26\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"2039.61,-255.58 2048.28,-249.48 2037.7,-248.84 2039.61,-255.58\"/>\n",
       "</g>\n",
       "<!-- q2 pulse amplitude coarse&#45;&gt;AWG8 MW&#45;staircase -->\n",
       "<g id=\"edge61\" class=\"edge\">\n",
       "<title>q2 pulse amplitude coarse-&gt;AWG8 MW-staircase</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M2000.01,-230.77C1833.46,-226.27 1492.51,-213.49 1205.79,-180 1197.55,-179.04 1188.95,-177.83 1180.42,-176.5\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1180.9,-173.03 1170.47,-174.9 1179.79,-179.95 1180.9,-173.03\"/>\n",
       "</g>\n",
       "<!-- q2 frequency coarse -->\n",
       "<g id=\"node47\" class=\"node\">\n",
       "<title>q2 frequency coarse</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"2106.79\" cy=\"-162\" rx=\"81.79\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"2106.79\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\">q2 frequency coarse</text>\n",
       "</g>\n",
       "<!-- q2 pulse amplitude coarse&#45;&gt;q2 frequency coarse -->\n",
       "<g id=\"edge62\" class=\"edge\">\n",
       "<title>q2 pulse amplitude coarse-&gt;q2 frequency coarse</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M2103.03,-215.7C2103.58,-207.98 2104.24,-198.71 2104.85,-190.11\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"2108.35,-190.33 2105.57,-180.1 2101.37,-189.83 2108.35,-190.33\"/>\n",
       "</g>\n",
       "<!-- q2 mixer offsets drive -->\n",
       "<g id=\"node50\" class=\"node\">\n",
       "<title>q2 mixer offsets drive</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"2295.79\" cy=\"-162\" rx=\"89.08\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"2295.79\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\">q2 mixer offsets drive</text>\n",
       "</g>\n",
       "<!-- q2 pulse amplitude coarse&#45;&gt;q2 mixer offsets drive -->\n",
       "<g id=\"edge63\" class=\"edge\">\n",
       "<title>q2 pulse amplitude coarse-&gt;q2 mixer offsets drive</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M2144.85,-217.46C2174.26,-206.85 2213.37,-192.74 2244.42,-181.54\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"2245.97,-184.7 2254.19,-178.01 2243.59,-178.11 2245.97,-184.7\"/>\n",
       "</g>\n",
       "<!-- q2 mixer offsets readout -->\n",
       "<g id=\"node51\" class=\"node\">\n",
       "<title>q2 mixer offsets readout</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"2500.79\" cy=\"-162\" rx=\"97.48\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"2500.79\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\">q2 mixer offsets readout</text>\n",
       "</g>\n",
       "<!-- q2 pulse amplitude coarse&#45;&gt;q2 mixer offsets readout -->\n",
       "<g id=\"edge64\" class=\"edge\">\n",
       "<title>q2 pulse amplitude coarse-&gt;q2 mixer offsets readout</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M2171.75,-220.73C2241.87,-208.42 2349.61,-189.52 2422.53,-176.73\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"2423.34,-180.14 2432.58,-174.97 2422.13,-173.25 2423.34,-180.14\"/>\n",
       "</g>\n",
       "<!-- q2 mixer skewness drive -->\n",
       "<g id=\"node52\" class=\"node\">\n",
       "<title>q2 mixer skewness drive</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"1907.79\" cy=\"-162\" rx=\"98.58\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"1907.79\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\">q2 mixer skewness drive</text>\n",
       "</g>\n",
       "<!-- q2 pulse amplitude coarse&#45;&gt;q2 mixer skewness drive -->\n",
       "<g id=\"edge65\" class=\"edge\">\n",
       "<title>q2 pulse amplitude coarse-&gt;q2 mixer skewness drive</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M2058.74,-217.46C2029.63,-206.96 1991.01,-193.03 1960.13,-181.88\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1960.99,-178.47 1950.39,-178.37 1958.61,-185.06 1960.99,-178.47\"/>\n",
       "</g>\n",
       "<!-- q2 T2&#45;echo -->\n",
       "<g id=\"node43\" class=\"node\">\n",
       "<title>q2 T2-echo</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"1984.79\" cy=\"-306\" rx=\"51.19\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"1984.79\" y=\"-302.3\" font-family=\"Times,serif\" font-size=\"14.00\">q2 T2-echo</text>\n",
       "</g>\n",
       "<!-- q2 T2&#45;echo&#45;&gt;q2 pulse amplitude coarse -->\n",
       "<g id=\"edge53\" class=\"edge\">\n",
       "<title>q2 T2-echo-&gt;q2 pulse amplitude coarse</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M2009.6,-290.15C2025.86,-280.43 2047.38,-267.55 2065.54,-256.69\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"2067.36,-259.68 2074.15,-251.54 2063.77,-253.67 2067.36,-259.68\"/>\n",
       "</g>\n",
       "<!-- q2 T2&#45;star -->\n",
       "<g id=\"node44\" class=\"node\">\n",
       "<title>q2 T2-star</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"2101.79\" cy=\"-306\" rx=\"47.39\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"2101.79\" y=\"-302.3\" font-family=\"Times,serif\" font-size=\"14.00\">q2 T2-star</text>\n",
       "</g>\n",
       "<!-- q2 T2&#45;star&#45;&gt;q2 pulse amplitude coarse -->\n",
       "<g id=\"edge54\" class=\"edge\">\n",
       "<title>q2 T2-star-&gt;q2 pulse amplitude coarse</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M2101.79,-287.7C2101.79,-279.98 2101.79,-270.71 2101.79,-262.11\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"2105.29,-262.1 2101.79,-252.1 2098.29,-262.1 2105.29,-262.1\"/>\n",
       "</g>\n",
       "<!-- q2 gates restless&#45;&gt;q2 optimal weights -->\n",
       "<g id=\"edge59\" class=\"edge\">\n",
       "<title>q2 gates restless-&gt;q2 optimal weights</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M2211.79,-503.7C2211.79,-495.98 2211.79,-486.71 2211.79,-478.11\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"2215.29,-478.1 2211.79,-468.1 2208.29,-478.1 2215.29,-478.1\"/>\n",
       "</g>\n",
       "<!-- q2 room temp. dist. corr.&#45;&gt;AWG8 Flux&#45;staircase -->\n",
       "<g id=\"edge68\" class=\"edge\">\n",
       "<title>q2 room temp. dist. corr.-&gt;AWG8 Flux-staircase</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1961.93,-508.08C1901.81,-495.92 1811.98,-477.74 1749.91,-465.19\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1750.31,-461.7 1739.81,-463.14 1748.92,-468.56 1750.31,-461.7\"/>\n",
       "</g>\n",
       "<!-- q2 resonator frequency -->\n",
       "<g id=\"node48\" class=\"node\">\n",
       "<title>q2 resonator frequency</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"1910.79\" cy=\"-90\" rx=\"92.08\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"1910.79\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\">q2 resonator frequency</text>\n",
       "</g>\n",
       "<!-- q2 frequency coarse&#45;&gt;q2 resonator frequency -->\n",
       "<g id=\"edge57\" class=\"edge\">\n",
       "<title>q2 frequency coarse-&gt;q2 resonator frequency</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M2065.7,-146.33C2035.79,-135.64 1995.06,-121.1 1962.87,-109.6\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1963.77,-106.21 1953.18,-106.14 1961.42,-112.8 1963.77,-106.21\"/>\n",
       "</g>\n",
       "<!-- q2 resonator frequency&#45;&gt;3 qubit device resonator frequencies coarse -->\n",
       "<g id=\"edge67\" class=\"edge\">\n",
       "<title>q2 resonator frequency-&gt;3 qubit device resonator frequencies coarse</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M1844.62,-77.36C1779.39,-65.89 1679.11,-48.25 1605.86,-35.37\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"1606.16,-31.87 1595.71,-33.58 1604.95,-38.76 1606.16,-31.87\"/>\n",
       "</g>\n",
       "<!-- q2 frequency fine -->\n",
       "<g id=\"node49\" class=\"node\">\n",
       "<title>q2 frequency fine</title>\n",
       "<ellipse fill=\"#d3d3d3\" stroke=\"#d3d3d3\" cx=\"2239.79\" cy=\"-306\" rx=\"72.59\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"2239.79\" y=\"-302.3\" font-family=\"Times,serif\" font-size=\"14.00\">q2 frequency fine</text>\n",
       "</g>\n",
       "<!-- q2 frequency fine&#45;&gt;q2 pulse amplitude coarse -->\n",
       "<g id=\"edge58\" class=\"edge\">\n",
       "<title>q2 frequency fine-&gt;q2 pulse amplitude coarse</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M2209.16,-289.46C2189.66,-279.57 2164.15,-266.63 2142.9,-255.85\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"2144.27,-252.62 2133.77,-251.22 2141.11,-258.87 2144.27,-252.62\"/>\n",
       "</g>\n",
       "<!-- q2 pulse amplitude med&#45;&gt;q2 frequency fine -->\n",
       "<g id=\"edge66\" class=\"edge\">\n",
       "<title>q2 pulse amplitude med-&gt;q2 frequency fine</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M2225.49,-359.7C2227.6,-351.9 2230.15,-342.51 2232.51,-333.83\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"2235.91,-334.67 2235.15,-324.1 2229.15,-332.84 2235.91,-334.67\"/>\n",
       "</g>\n",
       "</g>\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.SVG object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "test_graph.cfg_plot_mode = 'svg'\n",
    "DAG.update_monitor()\n",
    "# This graph is so big, the html visualization is more suitable. \n",
    "display(SVG(DAG.cfg_svg_filename))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'/Users/adriaanrol/GitHubRepos/Personal/AutoDepGraph/autodepgraph/svg_viewer/svgviewer-6e8wz0xh.html'"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "url = test_graph.open_html_viewer()\n",
    "url"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "### Reset the state of all nodes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'calibrate_function': 'autodepgraph.node_functions.calibration_functions.test_calibration_True',\n",
       " 'check_function': 'autodepgraph.node_functions.check_functions.return_fixed_value',\n",
       " 'color': '#D3D3D3',\n",
       " 'fillcolor': '#D3D3D3',\n",
       " 'fixedsize': 'false',\n",
       " 'last_update': datetime.datetime(2018, 3, 17, 23, 44, 29, 972265),\n",
       " 'shape': 'ellipse',\n",
       " 'state': 'unknown',\n",
       " 'style': 'filled',\n",
       " 'timeout': inf,\n",
       " 'tolerance': 0}"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "DAG.nodes['CZ q0-q1']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [],
   "source": [
    "DAG.set_all_node_states('needs calibration')\n",
    "# DAG.set_all_node_states('unknown')\n",
    "DAG.update_monitor()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [],
   "source": [
    "DAG._construct_maintenance_methods(DAG.nodes.keys())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Maintaining node \"CZ q0-q1\".\n",
      "Maintaining node \"Chevron q0-q1\".\n",
      "Maintaining node \"3 qubit device multiplexed readout\".\n",
      "Maintaining node \"q0 optimal weights\".\n",
      "Maintaining node \"q0 pulse amplitude med\".\n",
      "Maintaining node \"q0 frequency fine\".\n",
      "Maintaining node \"q0 pulse amplitude coarse\".\n",
      "Maintaining node \"AWG8 MW-staircase\".\n",
      "\tCalibrating node AWG8 MW-staircase.\n",
      "\tCalibration of node AWG8 MW-staircase successful.\n",
      "Maintaining node \"q0 frequency coarse\".\n",
      "Maintaining node \"q0 resonator frequency\".\n",
      "Maintaining node \"3 qubit device resonator frequencies coarse\".\n",
      "\tCalibrating node 3 qubit device resonator frequencies coarse.\n",
      "\tCalibration of node 3 qubit device resonator frequencies coarse successful.\n",
      "\tCalibrating node q0 resonator frequency.\n",
      "\tCalibration of node q0 resonator frequency successful.\n",
      "\tCalibrating node q0 frequency coarse.\n",
      "\tCalibration of node q0 frequency coarse successful.\n",
      "Maintaining node \"q0 mixer offsets drive\".\n",
      "\tCalibrating node q0 mixer offsets drive.\n",
      "\tCalibration of node q0 mixer offsets drive successful.\n",
      "Maintaining node \"q0 mixer offsets readout\".\n",
      "\tCalibrating node q0 mixer offsets readout.\n",
      "\tCalibration of node q0 mixer offsets readout successful.\n",
      "Maintaining node \"q0 mixer skewness drive\".\n",
      "\tCalibrating node q0 mixer skewness drive.\n",
      "\tCalibration of node q0 mixer skewness drive successful.\n",
      "\tCalibrating node q0 pulse amplitude coarse.\n",
      "\tCalibration of node q0 pulse amplitude coarse successful.\n",
      "\tCalibrating node q0 frequency fine.\n",
      "\tCalibration of node q0 frequency fine successful.\n",
      "\tCalibrating node q0 pulse amplitude med.\n",
      "\tCalibration of node q0 pulse amplitude med successful.\n",
      "\tCalibrating node q0 optimal weights.\n",
      "\tCalibration of node q0 optimal weights successful.\n",
      "Maintaining node \"q1 optimal weights\".\n",
      "Maintaining node \"q1 pulse amplitude med\".\n",
      "Maintaining node \"q1 frequency fine\".\n",
      "Maintaining node \"q1 pulse amplitude coarse\".\n",
      "Maintaining node \"q1 frequency coarse\".\n",
      "Maintaining node \"q1 resonator frequency\".\n",
      "\tCalibrating node q1 resonator frequency.\n",
      "\tCalibration of node q1 resonator frequency successful.\n",
      "\tCalibrating node q1 frequency coarse.\n",
      "\tCalibration of node q1 frequency coarse successful.\n",
      "Maintaining node \"q1 mixer offsets drive\".\n",
      "\tCalibrating node q1 mixer offsets drive.\n",
      "\tCalibration of node q1 mixer offsets drive successful.\n",
      "Maintaining node \"q1 mixer offsets readout\".\n",
      "\tCalibrating node q1 mixer offsets readout.\n",
      "\tCalibration of node q1 mixer offsets readout successful.\n",
      "Maintaining node \"q1 mixer skewness drive\".\n",
      "\tCalibrating node q1 mixer skewness drive.\n",
      "\tCalibration of node q1 mixer skewness drive successful.\n",
      "\tCalibrating node q1 pulse amplitude coarse.\n",
      "\tCalibration of node q1 pulse amplitude coarse successful.\n",
      "\tCalibrating node q1 frequency fine.\n",
      "\tCalibration of node q1 frequency fine successful.\n",
      "\tCalibrating node q1 pulse amplitude med.\n",
      "\tCalibration of node q1 pulse amplitude med successful.\n",
      "\tCalibrating node q1 optimal weights.\n",
      "\tCalibration of node q1 optimal weights successful.\n",
      "Maintaining node \"q2 optimal weights\".\n",
      "Maintaining node \"q2 pulse amplitude med\".\n",
      "Maintaining node \"q2 frequency fine\".\n",
      "Maintaining node \"q2 pulse amplitude coarse\".\n",
      "Maintaining node \"q2 frequency coarse\".\n",
      "Maintaining node \"q2 resonator frequency\".\n",
      "\tCalibrating node q2 resonator frequency.\n",
      "\tCalibration of node q2 resonator frequency successful.\n",
      "\tCalibrating node q2 frequency coarse.\n",
      "\tCalibration of node q2 frequency coarse successful.\n",
      "Maintaining node \"q2 mixer offsets drive\".\n",
      "\tCalibrating node q2 mixer offsets drive.\n",
      "\tCalibration of node q2 mixer offsets drive successful.\n",
      "Maintaining node \"q2 mixer offsets readout\".\n",
      "\tCalibrating node q2 mixer offsets readout.\n",
      "\tCalibration of node q2 mixer offsets readout successful.\n",
      "Maintaining node \"q2 mixer skewness drive\".\n",
      "\tCalibrating node q2 mixer skewness drive.\n",
      "\tCalibration of node q2 mixer skewness drive successful.\n",
      "\tCalibrating node q2 pulse amplitude coarse.\n",
      "\tCalibration of node q2 pulse amplitude coarse successful.\n",
      "\tCalibrating node q2 frequency fine.\n",
      "\tCalibration of node q2 frequency fine successful.\n",
      "\tCalibrating node q2 pulse amplitude med.\n",
      "\tCalibration of node q2 pulse amplitude med successful.\n",
      "\tCalibrating node q2 optimal weights.\n",
      "\tCalibration of node q2 optimal weights successful.\n",
      "\tCalibrating node 3 qubit device multiplexed readout.\n",
      "\tCalibration of node 3 qubit device multiplexed readout successful.\n",
      "Maintaining node \"AWG8 Flux-staircase\".\n",
      "\tCalibrating node AWG8 Flux-staircase.\n",
      "\tCalibration of node AWG8 Flux-staircase successful.\n",
      "Maintaining node \"q0 gates restless\".\n",
      "\tCalibrating node q0 gates restless.\n",
      "\tCalibration of node q0 gates restless successful.\n",
      "Maintaining node \"q1 gates restless\".\n",
      "\tCalibrating node q1 gates restless.\n",
      "\tCalibration of node q1 gates restless successful.\n",
      "\tCalibrating node Chevron q0-q1.\n",
      "\tCalibration of node Chevron q0-q1 successful.\n",
      "Maintaining node \"q0 cryo dist. corr.\".\n",
      "Maintaining node \"q0 room temp. dist. corr.\".\n",
      "\tCalibrating node q0 room temp. dist. corr..\n",
      "\tCalibration of node q0 room temp. dist. corr. successful.\n",
      "\tCalibrating node q0 cryo dist. corr..\n",
      "\tCalibration of node q0 cryo dist. corr. successful.\n",
      "Maintaining node \"q1 cryo dist. corr.\".\n",
      "Maintaining node \"q1 room temp. dist. corr.\".\n",
      "\tCalibrating node q1 room temp. dist. corr..\n",
      "\tCalibration of node q1 room temp. dist. corr. successful.\n",
      "\tCalibrating node q1 cryo dist. corr..\n",
      "\tCalibration of node q1 cryo dist. corr. successful.\n",
      "\tCalibrating node CZ q0-q1.\n",
      "\tCalibration of node CZ q0-q1 successful.\n"
     ]
    }
   ],
   "source": [
    "DAG.maintain_CZ_q0_q1()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
